from elixir import *
import elixir as el

class RawScores(Entity):
#insert the field names here
        id = Field(Integer, primary_key = True)
        event_id = Field(Integer)
        ir001 = Field(String(1))
        ir002 = Field(String(1))
        ir003 = Field(String(1))
        ir004 = Field(String(1))
        ir005 = Field(String(1))
        ir006 = Field(String(1))
        ir007 = Field(String(1))
        ir008 = Field(String(1))
        ir009 = Field(String(1))
        ir010 = Field(String(1))
        ir011 = Field(String(1))
        ir012 = Field(String(1))
        ir013 = Field(String(1))
        ir014 = Field(String(1))
        ir015 = Field(String(1))
        ir016 = Field(String(1))
        ir017 = Field(String(1))
        ir018 = Field(String(1))
        ir019 = Field(String(1))
        ir020 = Field(String(1))
        ir021 = Field(String(1))
        ir022 = Field(String(1))
        ir023 = Field(String(1))
        ir024 = Field(String(1))
        ir025 = Field(String(1))
        ir026 = Field(String(1))
        ir027 = Field(String(1))
        ir028 = Field(String(1))
        ir029 = Field(String(1))
        ir030 = Field(String(1))
        ir031 = Field(String(1))
        ir032 = Field(String(1))
        ir033 = Field(String(1))
        ir034 = Field(String(1))
        ir035 = Field(String(1))
        ir036 = Field(String(1))
        ir037 = Field(String(1))
        ir038 = Field(String(1))
        ir039 = Field(String(1))
        ir040 = Field(String(1))
        ir041 = Field(String(1))
        ir042 = Field(String(1))
        ir043 = Field(String(1))
        ir044 = Field(String(1))
        ir045 = Field(String(1))
        ir046 = Field(String(1))
        ir047 = Field(String(1))
        ir048 = Field(String(1))
        ir049 = Field(String(1))
        ir050 = Field(String(1))
        ir051 = Field(String(1))
        ir052 = Field(String(1))
        ir053 = Field(String(1))
        ir054 = Field(String(1))
        ir055 = Field(String(1))
        ir056 = Field(String(1))
        ir057 = Field(String(1))
        ir058 = Field(String(1))
        ir059 = Field(String(1))
        ir060 = Field(String(1))
        ir061 = Field(String(1))
        ir062 = Field(String(1))
        ir063 = Field(String(1))
        ir064 = Field(String(1))
        ir065 = Field(String(1))
        ir066 = Field(String(1))
        ir067 = Field(String(1))
        ir068 = Field(String(1))
        ir069 = Field(String(1))
        ir070 = Field(String(1))
        ir071 = Field(String(1))
        ir072 = Field(String(1))
        ir073 = Field(String(1))
        ir074 = Field(String(1))
        ir075 = Field(String(1))
        ir076 = Field(String(1))
        ir077 = Field(String(1))
        ir078 = Field(String(1))
        ir079 = Field(String(1))
        ir080 = Field(String(1))
        ir081 = Field(String(1))
        ir082 = Field(String(1))
        ir083 = Field(String(1))
        ir084 = Field(String(1))
        ir085 = Field(String(1))
        ir086 = Field(String(1))
        ir087 = Field(String(1))
        ir088 = Field(String(1))
        ir089 = Field(String(1))
        ir090 = Field(String(1))
        ir091 = Field(String(1))
        ir092 = Field(String(1))
        ir093 = Field(String(1))
        ir094 = Field(String(1))
        ir095 = Field(String(1))
        ir096 = Field(String(1))
        ir097 = Field(String(1))
        ir098 = Field(String(1))
        ir099 = Field(String(1))
        ir100 = Field(String(1))
        ir101 = Field(String(1))
        ir102 = Field(String(1))
        ir103 = Field(String(1))
        ir104 = Field(String(1))
        ir105 = Field(String(1))
        ir106 = Field(String(1))
        ir107 = Field(String(1))
        ir108 = Field(String(1))
        ir109 = Field(String(1))
        ir110 = Field(String(1))
        ir111 = Field(String(1))
        ir112 = Field(String(1))
        ir113 = Field(String(1))
        ir114 = Field(String(1))
        ir115 = Field(String(1))
        ir116 = Field(String(1))
        ir117 = Field(String(1))
        ir118 = Field(String(1))
        ir119 = Field(String(1))
        ir120 = Field(String(1))
        ir121 = Field(String(1))
        ir122 = Field(String(1))
        ir123 = Field(String(1))
        ir124 = Field(String(1))
        ir125 = Field(String(1))
        ir126 = Field(String(1))
        ir127 = Field(String(1))
        ir128 = Field(String(1))
        ir129 = Field(String(1))
        ir130 = Field(String(1))
        ir131 = Field(String(1))
        ir132 = Field(String(1))
        ir133 = Field(String(1))
        ir134 = Field(String(1))
        ir135 = Field(String(1))
        ir136 = Field(String(1))
        ir137 = Field(String(1))
        ir138 = Field(String(1))
        ir139 = Field(String(1))
        ir140 = Field(String(1))
        ir141 = Field(String(1))
        ir142 = Field(String(1))
        ir143 = Field(String(1))
        ir144 = Field(String(1))
        ir145 = Field(String(1))
        ir146 = Field(String(1))
        ir147 = Field(String(1))
        ir148 = Field(String(1))
        ir149 = Field(String(1))
        ir150 = Field(String(1))
        ir151 = Field(String(1))
        ir152 = Field(String(1))
        ir153 = Field(String(1))
        ir154 = Field(String(1))
        ir155 = Field(String(1))
        ir156 = Field(String(1))
        ir157 = Field(String(1))
        ir158 = Field(String(1))
        ir159 = Field(String(1))
        ir160 = Field(String(1))
        ir161 = Field(String(1))
        ir162 = Field(String(1))
        ir163 = Field(String(1))
        ir164 = Field(String(1))
        ir165 = Field(String(1))
        ir166 = Field(String(1))
        ir167 = Field(String(1))
        ir168 = Field(String(1))
        ir169 = Field(String(1))
        ir170 = Field(String(1))
        ir171 = Field(String(1))
        ir172 = Field(String(1))
        ir173 = Field(String(1))
        ir174 = Field(String(1))
        ir175 = Field(String(1))
        ir176 = Field(String(1))
        ir177 = Field(String(1))
        ir178 = Field(String(1))
        ir179 = Field(String(1))
        ir180 = Field(String(1))
        ir181 = Field(String(1))
        ir182 = Field(String(1))
        ir183 = Field(String(1))
        ir184 = Field(String(1))
        ir185 = Field(String(1))
        ir186 = Field(String(1))
        ir187 = Field(String(1))
        ir188 = Field(String(1))
        ir189 = Field(String(1))
        ir190 = Field(String(1))
        ir191 = Field(String(1))
        ir192 = Field(String(1))
        ir193 = Field(String(1))
        ir194 = Field(String(1))
        ir195 = Field(String(1))
        ir196 = Field(String(1))
        ir197 = Field(String(1))
        ir198 = Field(String(1))
        ir199 = Field(String(1))
        ir200 = Field(String(1))
        ir201 = Field(String(1))
        ir202 = Field(String(1))
        ir203 = Field(String(1))
        ir204 = Field(String(1))
        ir205 = Field(String(1))
        ir206 = Field(String(1))
        ir207 = Field(String(1))
        ir208 = Field(String(1))
        ir209 = Field(String(1))
        ir210 = Field(String(1))
        ir211 = Field(String(1))
        ir212 = Field(String(1))
        ir213 = Field(String(1))
        ir214 = Field(String(1))
        ir215 = Field(String(1))
        ir216 = Field(String(1))
        ir217 = Field(String(1))
        ir218 = Field(String(1))
        ir219 = Field(String(1))
        ir220 = Field(String(1))
        ir221 = Field(String(1))
        ir222 = Field(String(1))
        ir223 = Field(String(1))
        ir224 = Field(String(1))
        ir225 = Field(String(1))
        ir226 = Field(String(1))
        ir227 = Field(String(1))
        ir228 = Field(String(1))
        ir229 = Field(String(1))
        ir230 = Field(String(1))
        ir231 = Field(String(1))
        ir232 = Field(String(1))
        ir233 = Field(String(1))
        ir234 = Field(String(1))
        ir235 = Field(String(1))
        ir236 = Field(String(1))
        ir237 = Field(String(1))
        ir238 = Field(String(1))
        ir239 = Field(String(1))
        ir240 = Field(String(1))
        ir241 = Field(String(1))
        ir242 = Field(String(1))
        ir243 = Field(String(1))
        ir244 = Field(String(1))
        ir245 = Field(String(1))
        ir246 = Field(String(1))
        ir247 = Field(String(1))
        ir248 = Field(String(1))
        ir249 = Field(String(1))
        ir250 = Field(String(1))
        ir251 = Field(String(1))
        ir252 = Field(String(1))
        ir253 = Field(String(1))
        ir254 = Field(String(1))
        ir255 = Field(String(1))
        ir256 = Field(String(1))
        ir257 = Field(String(1))
        ir258 = Field(String(1))
        ir259 = Field(String(1))
        ir260 = Field(String(1))
        ir261 = Field(String(1))
        ir262 = Field(String(1))
        ir263 = Field(String(1))
        ir264 = Field(String(1))
        ir265 = Field(String(1))
        ir266 = Field(String(1))
        ir267 = Field(String(1))
        ir268 = Field(String(1))
        ir269 = Field(String(1))
        ir270 = Field(String(1))
        ir271 = Field(String(1))
        ir272 = Field(String(1))
        ir273 = Field(String(1))
        ir274 = Field(String(1))
        ir275 = Field(String(1))
        ir276 = Field(String(1))
        ir277 = Field(String(1))
        ir278 = Field(String(1))
        ir279 = Field(String(1))
        ir280 = Field(String(1))
        ir281 = Field(String(1))
        ir282 = Field(String(1))
        ir283 = Field(String(1))
        ir284 = Field(String(1))
        ir285 = Field(String(1))
        ir286 = Field(String(1))
        ir287 = Field(String(1))
        ir288 = Field(String(1))
        ir289 = Field(String(1))
        ir290 = Field(String(1))
        ir291 = Field(String(1))
        ir292 = Field(String(1))
        ir293 = Field(String(1))
        ir294 = Field(String(1))
        ir295 = Field(String(1))
        ir296 = Field(String(1))
        ir297 = Field(String(1))
        ir298 = Field(String(1))
        ir299 = Field(String(1))
        ir300 = Field(String(1))
        ir301 = Field(String(1))
        ir302 = Field(String(1))
        ir303 = Field(String(1))
        ir304 = Field(String(1))
        ir305 = Field(String(1))
        ir306 = Field(String(1))
        ir307 = Field(String(1))
        ir308 = Field(String(1))
        ir309 = Field(String(1))
        ir310 = Field(String(1))
        ir311 = Field(String(1))
        ir312 = Field(String(1))
        ir313 = Field(String(1))
        ir314 = Field(String(1))
        ir315 = Field(String(1))
        ir316 = Field(String(1))
        ir317 = Field(String(1))
        ir318 = Field(String(1))
        ir319 = Field(String(1))
        ir320 = Field(String(1))
        ir321 = Field(String(1))
        ir322 = Field(String(1))
        ir323 = Field(String(1))
        ir324 = Field(String(1))
        ir325 = Field(String(1))
        ir326 = Field(String(1))
        ir327 = Field(String(1))
        ir328 = Field(String(1))
        ir329 = Field(String(1))
        ir330 = Field(String(1))
        ir331 = Field(String(1))
        ir332 = Field(String(1))
        ir333 = Field(String(1))
        ir334 = Field(String(1))
        ir335 = Field(String(1))
        ir336 = Field(String(1))
        ir337 = Field(String(1))
        ir338 = Field(String(1))
        ir339 = Field(String(1))
        ir340 = Field(String(1))
        ir341 = Field(String(1))
        ir342 = Field(String(1))
        ir343 = Field(String(1))
        ir344 = Field(String(1))
        ir345 = Field(String(1))
        ir346 = Field(String(1))
        ir347 = Field(String(1))
        ir348 = Field(String(1))
        ir349 = Field(String(1))
        ir350 = Field(String(1))
        ir351 = Field(String(1))
        ir352 = Field(String(1))
        ir353 = Field(String(1))
        ir354 = Field(String(1))
        ir355 = Field(String(1))
        ir356 = Field(String(1))
        ir357 = Field(String(1))
        ir358 = Field(String(1))
        ir359 = Field(String(1))
        ir360 = Field(String(1))
        ir361 = Field(String(1))
        ir362 = Field(String(1))
        ir363 = Field(String(1))
        ir364 = Field(String(1))
        ir365 = Field(String(1))
        ir366 = Field(String(1))
        ir367 = Field(String(1))
        ir368 = Field(String(1))
        ir369 = Field(String(1))
        ir370 = Field(String(1))
        ir371 = Field(String(1))
        ir372 = Field(String(1))
        ir373 = Field(String(1))
        ir374 = Field(String(1))
        ir375 = Field(String(1))
        ir376 = Field(String(1))
        ir377 = Field(String(1))
        ir378 = Field(String(1))
        ir379 = Field(String(1))
        ir380 = Field(String(1))
        ir381 = Field(String(1))
        ir382 = Field(String(1))
        ir383 = Field(String(1))
        ir384 = Field(String(1))
        ir385 = Field(String(1))
        ir386 = Field(String(1))
        ir387 = Field(String(1))
        ir388 = Field(String(1))
        ir389 = Field(String(1))
        ir390 = Field(String(1))
        ir391 = Field(String(1))
        ir392 = Field(String(1))
        ir393 = Field(String(1))
        ir394 = Field(String(1))
        ir395 = Field(String(1))
        ir396 = Field(String(1))
        ir397 = Field(String(1))
        ir398 = Field(String(1))
        ir399 = Field(String(1))
        ir400 = Field(String(1))
        ir401 = Field(String(1))
        ir402 = Field(String(1))
        ir403 = Field(String(1))
        ir404 = Field(String(1))
        ir405 = Field(String(1))
        ir406 = Field(String(1))
        ir407 = Field(String(1))
        ir408 = Field(String(1))
        ir409 = Field(String(1))
        ir410 = Field(String(1))
        ir411 = Field(String(1))
        ir412 = Field(String(1))
        ir413 = Field(String(1))
        ir414 = Field(String(1))
        ir415 = Field(String(1))
        ir416 = Field(String(1))
        ir417 = Field(String(1))
        ir418 = Field(String(1))
        ir419 = Field(String(1))
        ir420 = Field(String(1))
        ir421 = Field(String(1))
        ir422 = Field(String(1))
        ir423 = Field(String(1))
        ir424 = Field(String(1))
        ir425 = Field(String(1))
        ir426 = Field(String(1))
        ir427 = Field(String(1))
        ir428 = Field(String(1))
        ir429 = Field(String(1))
        ir430 = Field(String(1))
        ir431 = Field(String(1))
        ir432 = Field(String(1))
        ir433 = Field(String(1))
        ir434 = Field(String(1))
        ir435 = Field(String(1))
        ir436 = Field(String(1))
        ir437 = Field(String(1))
        ir438 = Field(String(1))
        ir439 = Field(String(1))
        ir440 = Field(String(1))
        ir441 = Field(String(1))
        ir442 = Field(String(1))
        ir443 = Field(String(1))
        ir444 = Field(String(1))
        ir445 = Field(String(1))
        ir446 = Field(String(1))
        ir447 = Field(String(1))
        ir448 = Field(String(1))
        ir449 = Field(String(1))
        ir450 = Field(String(1))
        ir451 = Field(String(1))
        ir452 = Field(String(1))
        ir453 = Field(String(1))
        ir454 = Field(String(1))
        ir455 = Field(String(1))
        ir456 = Field(String(1))
        ir457 = Field(String(1))
        ir458 = Field(String(1))
        ir459 = Field(String(1))
        ir460 = Field(String(1))
        ir461 = Field(String(1))
        ir462 = Field(String(1))
        ir463 = Field(String(1))
        ir464 = Field(String(1))
        ir465 = Field(String(1))
        ir466 = Field(String(1))
        ir467 = Field(String(1))
        ir468 = Field(String(1))
        ir469 = Field(String(1))
        ir470 = Field(String(1))
        ir471 = Field(String(1))
        ir472 = Field(String(1))
        ir473 = Field(String(1))
        ir474 = Field(String(1))
        ir475 = Field(String(1))
        ir476 = Field(String(1))
        ir477 = Field(String(1))
        ir478 = Field(String(1))
        ir479 = Field(String(1))
        ir480 = Field(String(1))
        ir481 = Field(String(1))
        ir482 = Field(String(1))
        ir483 = Field(String(1))
        ir484 = Field(String(1))
        ir485 = Field(String(1))
        ir486 = Field(String(1))
        ir487 = Field(String(1))
        ir488 = Field(String(1))
        ir489 = Field(String(1))
        ir490 = Field(String(1))
        ir491 = Field(String(1))
        ir492 = Field(String(1))
        ir493 = Field(String(1))
        ir494 = Field(String(1))
        ir495 = Field(String(1))
        ir496 = Field(String(1))
        ir497 = Field(String(1))
        ir498 = Field(String(1))
        ir499 = Field(String(1))
        ir500 = Field(String(1))
        ir501 = Field(String(1))
        ir502 = Field(String(1))
        ir503 = Field(String(1))
        ir504 = Field(String(1))
        ir505 = Field(String(1))
        ir506 = Field(String(1))
        ir507 = Field(String(1))
        ir508 = Field(String(1))
        ir509 = Field(String(1))
        ir510 = Field(String(1))
        ir511 = Field(String(1))
        ir512 = Field(String(1))
        ir513 = Field(String(1))
        ir514 = Field(String(1))
        ir515 = Field(String(1))
        ir516 = Field(String(1))
        ir517 = Field(String(1))
        ir518 = Field(String(1))
        ir519 = Field(String(1))
        ir520 = Field(String(1))
        ir521 = Field(String(1))
        ir522 = Field(String(1))
        ir523 = Field(String(1))
        ir524 = Field(String(1))
        ir525 = Field(String(1))
        ir526 = Field(String(1))
        ir527 = Field(String(1))
        ir528 = Field(String(1))
        ir529 = Field(String(1))
        ir530 = Field(String(1))
        ir531 = Field(String(1))
        ir532 = Field(String(1))
        ir533 = Field(String(1))
        ir534 = Field(String(1))
        ir535 = Field(String(1))
        ir536 = Field(String(1))
        ir537 = Field(String(1))
        ir538 = Field(String(1))
        ir539 = Field(String(1))
        ir540 = Field(String(1))
        ir541 = Field(String(1))
        ir542 = Field(String(1))
        ir543 = Field(String(1))
        ir544 = Field(String(1))
        ir545 = Field(String(1))
        ir546 = Field(String(1))
        ir547 = Field(String(1))
        ir548 = Field(String(1))
        ir549 = Field(String(1))
        ir550 = Field(String(1))
        ir551 = Field(String(1))
        ir552 = Field(String(1))
        ir553 = Field(String(1))
        ir554 = Field(String(1))
        ir555 = Field(String(1))
        ir556 = Field(String(1))
        ir557 = Field(String(1))
        ir558 = Field(String(1))
        ir559 = Field(String(1))
        ir560 = Field(String(1))
        ir561 = Field(String(1))
        ir562 = Field(String(1))
        ir563 = Field(String(1))
        ir564 = Field(String(1))
        ir565 = Field(String(1))
        ir566 = Field(String(1))
        ir567 = Field(String(1))

        def __repr__ (self):
                return 'MMPI2 "event_id %d">' %(self.event_id)







class RawDbLoader(object):
    def __init__ (self):
        el.metadata.bind = 'insert correct db info here'
        el.metadata.bind.echo = True

        el.setup_all()
        el.create_all()

    def load_database(self, dictionary):
        raw = RawScores()
        raw.from_dict(d)
        session.commit()